<?php if(!defined('HDPHP_PATH'))exit;C('SHOW_NOTICE',FALSE);?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
	<title></title>
	<link rel="stylesheet" href="http://127.0.0.1/hdwy/wasai/Public/Bootstrap/Css/bootstrap.min.css" />
	<link rel="stylesheet" href="http://127.0.0.1/hdwy/wasai/Application/Admin/View/Public/Css/common.css" />
	<script type="text/javascript" src="http://127.0.0.1/hdwy/wasai/Static/jquery-1.7.2.min.js"></script>
     <script type="text/javascript">
     	$(function(){
     		//删除图片
     		$('.del-img').click(function(){
     			$(this).parents('td').html('<input type="file" name="toppic" id="" />');
     		})
     	})
     </script>		
</head>
<body>
	<form action="" method='post' enctype="multipart/form-data">
		<div class="container-fluid">
			<div class="row-fluid">
				<div class="span12">
					<fieldset>
					<legend>修改商品分类</legend> 
					<table class="table table-bordered table-hover">
						<tr class="info">
							<td>所属分类</td>
							<td>
								<select name="pid" >	
									<option value="0">顶级分类</option>
									<?php foreach ($cateData as $k=>$v){?>
										<option value="<?php echo $v['cid'];?>"     <?php if($oldData['pid']==$v['cid']){ ?>selected<?php } ?> ><?php echo $v['_name'];?></option>	
									<?php }?>
								</select>
							</td>
						</tr>						
						    <?php if($pid!=0){ ?>
							<tr class="info">
								<td>所属类型</td>
								<td>
									<select name="type_tid" >	
										<option value="0">请选择</option>
										<?php foreach ($type as $k=>$v){?>
											<option value="<?php echo $v['tid'];?>"     <?php if($oldData['type_tid']==$v['tid']){ ?>selected<?php } ?> ><?php echo $v['tname'];?></option>		
										<?php }?>
									</select>
								</td>
							</tr>	
						<?php } ?>
						    <?php if($oldData['pid']==0){ ?>
							<tr class="info">
								<td>分类图片</td>
								<td>								
								    <input type="hidden" name="toppic" value="<?php echo $oldData['toppic'];?>"/>
			                		<img src="http://127.0.0.1/hdwy/wasai/<?php echo $oldData['toppic'];?>" style="width: 400px;height: 300px;"/>	
			                		<a href="javascript:;" class="del-img" style="color:#000;text-decoration: none;">X</a>										
								</td>
							</tr>	
						<?php } ?>
						<tr class="info">
							<td>分类名称</td>
							<td>
								<input type="text" name='cname' value="<?php echo $oldData['cname'];?>"/>
							</td>
						</tr>
						<tr>
							<td colspan="2" align="center">
								<input type="submit" value="修改分类" class="btn btn-primary" />
							</td>
						</tr>
					</table>
					</fieldset>
				</div>
			</div>
		</div>
	</form>
</body>
</html>